import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import GoodsList from '@/components/GoodsList'
import MyCart from '@/components/MyCart'
import CouponTemplate from '@/components/CouponTemplate'
import CouponInsert from '@/components/CouponInsert'
import GetCoupon from '@/components/GetCoupon'

//解决vue-router 3.0以上 重复路由报错的问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      component: Index
    },
	{
	  path:'/GoodsList',
	  component: GoodsList
	},
	{
	  path:'/MyCart',
	  component: MyCart
	},
	{
	  path:'/CouponTemplate',
	  component: CouponTemplate
	},
	{
	  path:'/CouponInsert',
	  component: CouponInsert
	},
	{
	  path:'/GetCoupon',
	  component: GetCoupon
	}
  ]
})